﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using ExpressionTreeLib;

namespace EditorExe.StepRequestDialogs
{
    /// <summary>
    /// Interaction logic for RequestLongText.xaml
    /// </summary>
    public partial class RequestLongText : Window, IStepRequest<LongText>
    {
        public RequestLongText()
        {
            InitializeComponent();
        }

        public bool Request(ref LongText input)
        {
            this.button1.Content = "Next";
            return this.LastRequest(ref input);
        }

        public bool LastRequest(ref LongText input)
        {
            this.textBox1.Text = input.Text;
            if(this.ShowDialog() ?? false)
            {
                input.Text = this.textBox1.Text;
                return true;
            }

            return false;
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
            this.Close();
        }
    }
}
